package xing2387.filtervideoplayer.item

import android.os.Bundle
import android.view.View
import androidx.fragment.app.Fragment
import xing2387.filtervideoplayer.player.GLPlayer

open class VideoPageFragment() : Fragment() {

    protected var videoUrl: String = ""

    constructor(url: String) : this() {
        videoUrl = url
        saveArgument(url)
    }

    private fun saveArgument(url: String) {
        val extras = Bundle()
        extras.putString("videoUrl", url);
        arguments = extras
    }

    private fun parseArgument() {
        videoUrl = arguments?.getString("videoUrl") ?: ""
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        parseArgument()
    }

    open fun onAttachPlayer() {
    }

    open fun onDetachPlayer() {
    }

}